export default {
  data() {
    return {};
  },
  onLoad: function () {
    // #ifdef MP-WEIXIN
    wx.showShareMenu({
      withShareTicket: true,
      menus: ['shareAppMessage', 'shareTimeline'],
    });
    // #endif
  },
  onShareAppMessage(res) {
    let that = this;
    // let imageUrl = that.shareUrl || '';
    if (res.from === 'button') {
      // //这块需要传参，不然链接地址进去获取不到数据
      // let path = `/` + that.$scope.route + `?item=` + that.$scope.options.item;
      // return {
      // 	title: '商品分享~',
      // 	path: path,
      // 	imageUrl: imageUrl
      // };
    }
    if (res.from === 'menu') {
      return {
        title: '上饶中农批',
        path: 'pages/index/index',
        imageUrl: 'http://cdn.jxsr.com/znpwxfx.png',
      };
    }
  },
  // 分享到朋友圈
  onShareTimeline() {
    return {
      title: '上饶中农批',
      path: 'pages/index/index',
      imageUrl: 'http://cdn.jxsr.com/znpwxfx.png',
    };
  },
  methods: {},
};
